package org.example.crazy.z_factory_model.factory;

import org.example.crazy.z_factory_model.product.AbstractFruit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Author yzz
 * @CreateTime 2025/04/19
 * @描述: SimpleFactory 简单工厂模式
 */
@Component
public class SimpleFactory {

    @Autowired
    private Map<String, AbstractFruit> map;

    public AbstractFruit getFruit(String name){
        return map.get(name);
    }
}
